﻿using Core.Domain.Entities;
using Core.Domain.ValueObjects;
using Core.Migrations.Extensions;
using FluentMigrator;

namespace Infrastructure.Persistence.Migrations.UserProfiles;

[Migration(202511081158)]
public class CreateColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(typeof(UserProfile).GetTableName())
          .InSchema(SchemaNames.Identity)
          .AddColumn("TenantId").AsString(100).Nullable().WithColumnDescription("租户标识")
          .AddColumn(MigrationExpressions.ColumnNameFor<UserProfile>(nameof(UserProfile.UserId)))
          .AsGuid().Nullable()
          .WithColumnDescription("用户ID");



        Alter.Table("UserPreferences")
          .InSchema(SchemaNames.Identity)
          .AddColumn("TenantId").AsString(100).Nullable().WithColumnDescription("租户标识");
    }
}
